1. Field of the Invention
The present invention is a method and apparatus for determining the frequency components of a waveform that is sampled at a discrete set of times, and more particularly, for determining the Fourier coefficients of the output waveform of a circuit or a simulator, based on samples of the output waveform taken at selected time intervals.
2. Related Art
In order to characterize the behavior of circuits and electronic systems, it is often useful to analyze the frequency components of the output waveform that is generated by the circuit or electronic system. The output waveform may be generated by an actual circuit or electronic system, but more typically it is generated by a circuit simulator. Typically, the simulator is driven by a reference signal at a fundamental frequency and the amplitudes of the various harmonic frequencies in the output waveform are identified by means of Fourier analysis, whereby the time-dependent output waveform of the circuit or system is transformed into a frequency-domain function. The amplitude of the frequency domain function at a given frequency indicates the relative contribution of the frequency to the output waveform. The results of Fourier analysis are typically represented as a series of Fourier coefficients, the magnitudes of which indicate the distribution of energy in the output waveform among the fundamental and harmonic frequencies.
Conventional Fourier analyzers typically detect the actual or simulated output waveform at uniform time intervals, (the sampling rate) and the integral transforth that relates the Fourier coefficient to the detected output waveform is approximated by a discrete Fourier series. The terms of this Fourier series are determined for each time interval using a representative value of the output waveform for the interval and summing each term in the series.
Accurate analysis of the frequency components of an output waveform requires careful selection of the sampling rate, since this rate limits the frequency components that can be resolved in a Fourier analysis. The highest frequency component of a waveform that can be accurately resolved by sampling the waveform every .DELTA. seconds is (2.DELTA.).sup.-1. Frequency components falling outside the range .+-.(2.DELTA.).sup.-1 vary too quickly to be accurately resolved by sampling every .DELTA. seconds. Instead, the energy in these frequency components is added to Fourier coefficients of frequency components within the range. The resulting distortion of the Fourier coefficients is referred to as aliasing and is a major source of errors in the Fourier analysis of broad band output waveforms. For this reason, the sampling rate must be selected so that all frequency components having substantial amplitude in the output waveform fall within the frequency range, .+-.(2.DELTA.).sup.-1. This is a particularly burdensome requirement for output waveforms having broad frequency bands.
Even where the sampling rate is sufficiently fast to resolve substantially all frequency components in an output waveform, discontinuous artifacts in the waveforms generate error components across a broad band of frequencies. Aliasing couples the errors at frequencies outside the range, .+-.(2.DELTA.).sup.-1, into the Fourier coefficients of frequencies within the range. Such error producing discontinuities arise, for example, where an output waveform has not completely settled between analysis cycles, where the wrong period is used for the waveform, or where the waveform computed by a simulator is not completely converged.
Errors in Fourier coefficients may also be introduced through the interpolation method used by a simulator to compute the output waveform. Particularly where the simulator employs a low order interpolation scheme, the time step between adjacent points of the simulated output waveform must be sufficiently small to keep errors in the interpolated output waveform within selected limits. However, small time steps are unnecessary for analyzing the relatively flat portions of the output waveform, and the selected time step typically represents a trade off between accuracy and efficiency in computing the output waveform.